storBattery = new Vue({
	el: "#storBattery",
	data: {
		currentUser:'', // 当前用户信息
		parentObject:{},
		list:[], //本次检查记录
		elseDesc:'',
		weatherList:[],
		actionList:[],
		toolCheckAddEditVisible:false,
	},
	components:{
		processlog, // 流程日志	
	},
	created: function() {
		let _this = this
		_this.currentUser = JSON.parse(localStorage.getItem("neiosUser"))
		_this.parentObject = JSON.parse(localStorage.getItem("neiosGoDetail")).obj
		// 获取码表
		let dictCodes = 'ARRESTER_ACTCAUSE,ARRESTER_WEATHER';
		let dict = mui.neiosCommon.queryDict(dictCodes, (data) => {
			if (data != '') {
				_this.actionList = data.ARRESTER_ACTCAUSE
				_this.weatherList = data.ARRESTER_WEATHER 
			}
		})
		_this.getList()
	},
	methods: {
		// 周期码表转换
		cycleUnitChange (data,type) {
			if (type == '0') {
				return mui.neiosCommon.dictTransform(this.weatherList,data)
			} else if (type == '1') {
				return mui.neiosCommon.dictTransform(this.actionList,data)
			}
		},
		//获取列表
		getList(){
			let _this = this
			//网络安全列表
			let param = {
				"workId": this.parentObject.workId
			}
			mui.neiosRequst.httpRequst('/app/regularWork/arresterAction/getArresterActionInfoByWorkId', param,
			(data)=> {
				_this.list = data.data
			},
			function(data) {
		
			})
		},
		// 查看详情
		upToolCheckDialogFn (item) {
			this.toolCheckAddEditVisible = true
			this.formData = JSON.parse(JSON.stringify(item))
		},
		// 关闭
		closeToolCheckAddEdit () {
			this.toolCheckAddEditVisible = false
			this.formData = {
				deviceName:'',
				deviceCode:'',
				neiosCheckItemNoteList:[]
			}
			this.formData.checkStaffCodeName = ''
			this.formData.checkDate = ''
		},
		//获取时间
		getTime(myDate, type) {
			var realYear = myDate.getFullYear();
			var myMonth = myDate.getMonth() + 1;
			var realMonth = myMonth;
			var myDay = myDate.getDate();
			var realDay = myDay;
			var myHour = myDate.getHours();
			var realHours = myHour;
			var myMinute = myDate.getMinutes();
			var realMinute = myMinute;
			var mySecond = myDate.getSeconds();
			var realSecond = mySecond;
			if (myMonth < 10) {
				realMonth = "0" + myMonth;
			}
			if (myDay < 10) {
				realDay = "0" + myDay;
			}
			if (myMinute < 10) {
				realMinute = "0" + myMinute;
			}
			if (myHour < 10) {
				realHours = "0" + myHour;
			}
			if (mySecond < 10) {
				realSecond = "0" + mySecond;
			}
			var realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours + ':' + realMinute + ':' +
				realSecond;
			if (type == "sec") {
				realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours + ':' + realMinute + ':' + realSecond;
			} else if (type == "min") {
				realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours + ':' + realMinute;
			} else if (type == "hour") {
				realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours;
			} else if (type == "day") {
				realDate = realYear + '-' + realMonth + '-' + realDay;
			} else if (type == "month") {
				realDate = realYear + '-' + realMonth;
			} else if (type == "year") {
				realDate = realYear;
			}
			return realDate;
		},
		
		
		// 返回
		goBack () {
			mui.back()
		}
	}
});